TraffEduObject Class Reference

#include <TraffEduObject.h>

Inheritance diagram for TraffEduObject:

EnvironmentObject Path TrafficLight TrafficSign Vehicle Wheel List of all members.

Public Member Functions

virtual void draw (osg::ref_ptr< osg::Group > root, int animationFlag=-1)=0
void addTree (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
osg::PositionAttitudeTransform * getPAT ()
void setScale (float x, float y, float z)
void setPosition (float x, float y, float z)
void setRotate (float x, float y, float z, float axis)
osg::Vec3d getScale ()
osg::Vec3d getPosition ()
osg::Quat getRotate ()
char getCondition ()
void setCondition (char chr)
int getObjectId ()
void setObjectId ()
int getIsBeforeCreated ()
void setModelPath (string str)
string getModelPath ()
void resetModelPath (string str)
void hide (osg::ref_ptr< osg::Group > root)
void display (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
void setObjectType (ObjectType type)
ObjectType getObjectType ()
void setModelScale (float scale)
float getModelScale ()
double getm_drotz ()
osg::ref_ptr< osg::Node > returnNode ()
osg::ref_ptr< osg::Node > returnNode (int i)
osg::ref_ptr< osg::PositionAttitudeTransform > getObjectPAT ()
void setInAnimation (int i)
int objectPATvectorSize ()
void setIsBeforeCreated (int flag)
vector< vehiclePAT * > & getObjectPATvector ()
void resetObjectId ()
osg::ref_ptr< osg::Group > getObjectGroup ()
 TraffEduObject ()
 TraffEduObject (string modelpath, float scalevalue)
 ~TraffEduObject ()
int addObjectPAT (int i)
int deleteObjectPAT (int i)
osg::ref_ptr< osg::PositionAttitudeTransform > reloadObjectPAT ()
void setAsPhysicalVehicle ()
bool isPhysicalVehicle ()
void setCameraFollow ()
bool isCameraFollow ()
void resetCameraFollow ()
void undoPhysicalVehicle ()

Protected Member Functions

void sortObjectPATvector ()
int returnIndex (int)

Protected Attributes

ObjectType type
int objectId
int viewMode
string modelPath
osg::ref_ptr< osg::PositionAttitudeTransform > objectPAT
vector< vehiclePAT * > objectPATvector
float modelScale
char condition
int isBeforeCreated
int inAnimation
double m_drotz
int cameraFollow
osg::ref_ptr< osg::Group > objectGroup
osg::ref_ptr< osg::Geometry > objectGeometry
osg::ref_ptr< osg::Geode > objectGeode
osg::ref_ptr< osg::Node > node
int physicalVehicle

Constructor & Destructor Documentation

TraffEduObject::TraffEduObject (   ) 
 

TraffEduObject constructor

TraffEduObject::TraffEduObject (  string  modelpath,
float  scalevalue
) 
 

TraffEduObject constructor

Parameters:
modelpath 
scalevalue 

TraffEduObject::~TraffEduObject (   ) 
 

TraffEduObject destructor


Member Function Documentation

int TraffEduObject::addObjectPAT (  int  i  ) 
 

addObjectPAT

Parameters:
i Add the corresponding PAT, objectGeode and ObjectGroup to the objectPAT

void TraffEduObject::addTree (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
) 
 

Parameters:
root 
animationFlag The PAT of the objects are added to the root for drawing then in the scene.

int TraffEduObject::deleteObjectPAT (  int  i  ) 
 

deleteObjectPAT

Parameters:
i Delete the corresponding PAT, from the objectPAT

void TraffEduObject::display (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
) 
 

Inserts the object to the root if it is hidden.

Parameters:
root 
animationFlag 

virtual void TraffEduObject::draw (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
)  [pure virtual]
 

Parameters:
root 
animationFlag 

Implemented in EnvironmentObject, Path, TrafficLight, TrafficSign, Vehicle, and Wheel.

char TraffEduObject::getCondition (   ) 
 

Returns:
The condition of the object as deleted or not deleted

int TraffEduObject::getIsBeforeCreated (   ) 
 

Returns:
Whether the object is drawn before.

double TraffEduObject::getm_drotz (   )  [inline]
 

Returns:
the rotation value in z coordinates

string TraffEduObject::getModelPath (   ) 
 

Returns:
Gets the path of the model of the object

float TraffEduObject::getModelScale (   ) 
 

Returns:
The scale factor of the model

osg::ref_ptr<osg::Group> TraffEduObject::getObjectGroup (   )  [inline]
 

int TraffEduObject::getObjectId (   ) 
 

Returns:
Gets the id of the objects

osg::ref_ptr<osg::PositionAttitudeTransform> TraffEduObject::getObjectPAT (   ) 
 

Returns:
The osg::PositionAttitudeTransform matrix of the object

vector<vehiclePAT *>& TraffEduObject::getObjectPATvector (   ) 
 

Returns:
The vehiclePAT pointer vector of the object.

ObjectType TraffEduObject::getObjectType (   ) 
 

Returns:
The type of the object

osg::PositionAttitudeTransform* TraffEduObject::getPAT (   ) 
 

Returns:
The PAT of the object

osg::Vec3d TraffEduObject::getPosition (   ) 
 

Returns:
position values in 3 coordinates

osg::Quat TraffEduObject::getRotate (   ) 
 

Returns:
rotation values in 3 coordinates

osg::Vec3d TraffEduObject::getScale (   ) 
 

Returns:
scale values in 3 coordinates

void TraffEduObject::hide (  osg::ref_ptr< osg::Group >  root  ) 
 

hide function

Parameters:
root Remove the object from the root if it is displayed.

bool TraffEduObject::isCameraFollow (   ) 
 

isCameraFollow

Returns:
Whether the camera is set to follow a vehicle

bool TraffEduObject::isPhysicalVehicle (   ) 
 

Returns:
true if vehicle is a physical vehicle

int TraffEduObject::objectPATvectorSize (   ) 
 

Returns:
Size of the objectPATvector.

osg::ref_ptr<osg::PositionAttitudeTransform> TraffEduObject::reloadObjectPAT (   ) 
 

Returns:
osg::ref_ptr<osg::PositionAttitudeTransform> set objectPAT the same as the objectPAT<of the first frame

void TraffEduObject::resetCameraFollow (   ) 
 

resetCameraFollow sets the bool variable cameraFollow to 0.

void TraffEduObject::resetModelPath (  string  str  ) 
 

setModelPath function

Parameters:
str Resets the path of the model of the object

void TraffEduObject::resetObjectId (   ) 
 

sets objectId to 0.

int TraffEduObject::returnIndex (  int   )  [protected]
 

osg::ref_ptr<osg::Node> TraffEduObject::returnNode (  int  i  ) 
 

Parameters:
i int returns The node that the vehicle model is added

osg::ref_ptr<osg::Node> TraffEduObject::returnNode (   ) 
 

Returns:
The node that the vehicle model is added

void TraffEduObject::setAsPhysicalVehicle (   ) 
 

sets the variable that determines whether the vehicle needs a corresponding physical vehicle

void TraffEduObject::setCameraFollow (   ) 
 

SetCameraFollow sets the bool variable cameraFollow to 1.

void TraffEduObject::setCondition (  char  chr  ) 
 

Parameters:
chr sets the condition as deleted when parameter is 'd' or normal when parameter is 'a'

void TraffEduObject::setInAnimation (  int  i  ) 
 

Parameters:
i int Assigns inAnimation member to the function parameter

void TraffEduObject::setIsBeforeCreated (  int  flag  )  [inline]
 

void TraffEduObject::setModelPath (  string  str  ) 
 

Parameters:
str string sets the path of the model of the object

void TraffEduObject::setModelScale (  float  scale  ) 
 

Sets the scale factor of the model

Parameters:
scale 

void TraffEduObject::setObjectId (   ) 
 

sets the id of the objects

void TraffEduObject::setObjectType (  ObjectType  type  ) 
 

sets the type of the object to the objectType field

Parameters:
type objecttype sets the type of the object to the objectType field

void TraffEduObject::setPosition (  float  x,
float  y,
float  z
) 
 

Parameters:
x position in x coordinates
y position in y coordinates
z position in z coordinates set the position values to the PAT of the object.

void TraffEduObject::setRotate (  float  x,
float  y,
float  z,
float  axis
) 
 

Parameters:
x rotation in x coordinates
y rotation in y coordinates
z rotation in z coordinates
axis rotation axis set the position values to the PAT of the object.

void TraffEduObject::setScale (  float  x,
float  y,
float  z
) 
 

Parameters:
x scale value in x coordinates
y scale value in y coordinates
z scale value in z coordinates set the scale values to the PAT of the object.

void TraffEduObject::sortObjectPATvector (   )  [protected]
 

sorts the elements in the PAT vector according to the frame numbers.

void TraffEduObject::undoPhysicalVehicle (   ) 
 

undoPhysicalVehicle sets the bool variable physicalVehicle to 0.


Member Data Documentation

int TraffEduObject::cameraFollow [protected]
 

variable that keeps the boolean value for whether the camera will follow it or not.

char TraffEduObject::condition [protected]
 

variable that keeps the condition of the object.

int TraffEduObject::inAnimation [protected]
 

variable that keeps the boolean value for whether the object is in animation or not.

int TraffEduObject::isBeforeCreated [protected]
 

variable that keeps the boolean value of whet it is drawn or not.

double TraffEduObject::m_drotz [protected]
 

variable that keeps the rotation angle in z coordinates of the object.

string TraffEduObject::modelPath [protected]
 

variable that keeps the path of the model of the object.

float TraffEduObject::modelScale [protected]
 

variable that keeps the scale factor of the object.

osg::ref_ptr<osg::Node> TraffEduObject::node [protected]
 

osg::ref_ptr<osg::Geode> TraffEduObject::objectGeode [protected]
 

osg::ref_ptr<osg::Geometry> TraffEduObject::objectGeometry [protected]
 

osg::ref_ptr<osg::Group> TraffEduObject::objectGroup [protected]
 

int TraffEduObject::objectId [protected]
 

variable that keeps the id of the object

osg::ref_ptr<osg::PositionAttitudeTransform> TraffEduObject::objectPAT [protected]
 

variable that keeps the PositionAttitudeTransform of the model of the object.

vector<vehiclePAT *> TraffEduObject::objectPATvector [protected]
 

variable that keeps the vector of PositionAttitudeTransform of the model of the object.

int TraffEduObject::physicalVehicle [protected]
 

ObjectType TraffEduObject::type [protected]
 

variable that keeps the type of the object

int TraffEduObject::viewMode [protected]
 

variable that keeps the viewMode of the object; hide or display property.


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:01 2006 by  doxygen 1.4.6-NO